home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 23
/
AACD 23.iso
/
AACD
/
Programming
/
DragnDrop
/
doc
/
Dragndrop.doc
Wrap
Text File
|
2001-06-11
|
25KB
|
954 lines
TABLE OF CONTENTS
dragndrop.library/ActivateScreen
dragndrop.library/DND_CloseDrag
dragndrop.library/DND_Draw
dragndrop.library/DND_DrawPolygon
dragndrop.library/DND_FreeData
dragndrop.library/DND_FreeInfo
dragndrop.library/DND_FreeResult
dragndrop.library/DND_Get
dragndrop.library/DND_GetData
dragndrop.library/DND_Give
dragndrop.library/DND_GiveResult
dragndrop.library/DND_GiveData
dragndrop.library/DND_Info
dragndrop.library/DND_Isonline
dragndrop.library/DND_Login
dragndrop.library/DND_Logout
dragndrop.library/DND_MoveDrag
dragndrop.library/DND_OpenDrag
dragndrop.library/DND_OpenPolygon
dragndrop.library/DND_TestArea
dragndrop.library/DND_TestPolygon
dragndrop.library/DND_Whoisonline
dragndrop.library/SetMousePos
dragndrop.library/SetMousePosDelta
dragndrop.library/DND_OpenDragWB
dragndrop.library/DND_CheckforDataMsg
dragndrop.library/DND_GetDataMsg
dragndrop.library/DND_CheckForDataMsgFromID
dragndrop.library/DND_GetDataMsgFromID
dragndrop.library/ActivateScreen dragndrop.library/ActivateScreen
NAME
ActivateScreen -- activates screen , brings it NOT to front
SYNOPSIS
ActivateScreen(Screen)
A0
FUNCTION
This function activates the screen, so that a application can change
the inputscreen for the gui from one to another. Background of this is
to develop a two screen display.
INPUTS
Screen - a vaild screen structure
RESULT
NONE
BUGS
NONE
SEE ALSO
intuition.library/OpenScreen() , intuition.library/OpenScreenTagList()
dragndrop.library/DND_CloseDrag dragndrop.library/DND_CloseDrag
NAME
DND_CloseDrag -- Closes DragIcon on Screen
SYNOPSIS
DND_CloseDrag(Drag)
a0
DND_CloseDrag(Struct Drag)
FUNCTION
Removes dragicon from your screen and frees the dragstructure.
INPUTS
Drag - Result of DND_Opendrag()
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_OpenDrag() , DND_MoveDrag()
dragndrop.library/DND_Draw dragndrop.library/DND_Draw
NAME
DND_Draw -- Draws a given array of dragareas
SYNOPSIS
DND_Draw(Rastport,Field,Pen)
a0 a1 d0
DND_Draw(Struct Rastport,Struct Dragarea,Pencolor)
FUNCTION
Draws Dragborders of given array of dragareas into the given rastport
with the color defined with pen.
Use this function (only) to test your dragarray.
INPUTS
Rastport - Rastport of your Window/Screen
Field - Array of X-Y-Coordinates (from/to) (0,0)-Terminated
Pen - Pencolor to use while drawing
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_DrawPolygon()
dragndrop.library/DND_DrawPolygon dragndrop.library/DND_DrawPolygon
NAME
DND_DrawPolygon -- Draws a given dragpolygon
SYNOPSIS
DND_DrawPolygon(Rastport,Field,Pen)
a0 a1 d0
DND_DrawPolygon(Struct Rastport,Struct DragPolygon,Pencolor)
FUNCTION
Draws Dragborder of given dragpolygon into the given rastport
with the color defined with pen.
Use this function (only) to test your dragpolygon
INPUTS
Rastport - Rastport of your Window/Screen
Field - Array of X-Y-Coordinates (0,0)-Terminated
Pen - Pencolor to use while drawing
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_Draw()
dragndrop.library/DND_FreeData dragndrop.library/DND_FreeData
NAME
DND_FreeData -- frees datastructure
SYNOPSIS
DND_FreeData(Datastructure)
a0
DND_FreeData(Struct Datastructure)
FUNCTION
Frees memory used for Datastructure. You must free every datastructures
yourself.
INPUTS
Datastructure - Result of DND_GetData()
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_GetData()
dragndrop.library/DND_FreeInfo dragndrop.library/DND_FreeInfo
NAME
DND_FreeInfo -- Frees Infostructure
SYNOPSIS
DND_FreeInfo(InfoStructure)
a0
DND_FreeInfo(Struct InfoStructure)
FUNCTION
Frees Infostructure returned by DND_Info()
INPUTS
Infostructure - Result of DND_Info()
RESULT
NONE
* WARNING * DND_FreeInfo() and DND_Info() in version 1 do nothing and return
immediately.
BUGS
NONE
SEE ALSO
DND_Info()
dragndrop.library/DND_FreeResult dragndrop.library/DND_FreeResult
NAME
DND_FreeResult -- Frees TA_Result and TP_Result
SYNOPSIS
DND_FreeResult(T?_Result)
a0
DND_FreeResult(Struct T?_Result)
FUNCTION
Frees structures TA_Result and TP_Result.
INPUTS
T?_Result - Result of DND_TestArea() or DND_TestPolygon().
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_TestArea() , DND_TestPolygon()
dragndrop.library/DND_Get dragndrop.library/DND_Get
NAME
DND_Get -- Gets information send by other tasks
SYNOPSIS
ok = DND_Get(Task)
d0 d0
Long = DND_Get(Long Task)
FUNCTION
DND_Get() gets a message send by other tasks using DND-Library.
It searches the messagepipe for messages which have your tasknumber
as recipient. This message has information about the rastport and
coordinates the other TASK wants you to process. Think of a DragIcon
which jumps from one screen or application to another!
INPUTS
Task - Result of FindTask(0)
Task will be used as a unique number. If you ask why you can`t
use ultility.library/GetUniqueID() as a unique number, it`s easy.
How will you know which number another tasks uses?
You can also use valid windows as ID`s like DirectDos does.
RESULT
OK - returns -1 if function can`t find a message for Task or can`t
allocate memory.
returns address of a TA_Result-Structure
STRUCTURE TA_Resultstructure,0
Long X
Long Y
Long X1
Long Y1
Long Rastport
EXAMPLE
SendMessage:
TargetTask=FindTask("ASM-One")
MyTask=Findtask(0)
If (Result=DND_IsOnline(TargetTask))#0 {
DND_Give(TargetTask,Rastport,X,Y,X1,Y1,MyTask)
}
...
GetMessage:
MyTask=FindTask(0)
While (Result=DND_Get(MyTask))#0 {
Delay(1)
}
...Process...
DND_FreeResult(Result)
...
BUGS
NONE
SEE ALSO
DND_GetData()
dragndrop.library/DND_GetData dragndrop.library/DND_GetData
NAME
DND_GetData -- Gets datastructure send from another task
SYNOPSIS
OK = DND_GetData(Task)
d0 d0
Long = DND_GetData(Struct Task)
FUNCTION
Gets datastructure from datamessagepipe if there`s a message to get.
INPUTS
Task - see DND_Get()/INPUTS
RESULT
ok - returns -1 for failure or
address of Datastructure:
STRUCTURE Datastructure,0
Long TargetTask
Long SendTask
Long Data
APTR NextDatastructure ( Private! Don`t mess with that! )
BUGS
NONE
SEE ALSO
dragndrop.library/DND_Give dragndrop.library/DND_Give
NAME
DND_Give -- Send Information to another Task
SYNOPSIS
OK = DND_Give(TargetTask,Rastport, X , Y , X1 , Y1 ,MyTask)
d0 d0 a0 d1 d2 d3 d4 a1
Long = DND_Give(Struct Task,Struct Rastport,Long X,Long Y,Long X1,
Long Y1,Struct Task)
FUNCTION
This function sends information about the dragarea to another task.
INPUTS
Targettask - see DND_Get()/INPUTS
Mytask - see DND_Get()/INPUTS
Rastport - rastport where the icon is placed.
X,Y,X1,Y1 - coordinates of the dragicon
RESULT
ok - returns 0 if fails
returns -1 if success
BUGS
NONE
SEE ALSO
DND_Get(), DND_GiveResult()
dragndrop.library/DND_GiveResult dragndrop.library/DND_GiveResult
NAME
DND_GiveResult - Sends T?_Resultstructure to another task
SYNOPSIS
OK = DND_GiveResult(TargetTask,Rastport,T?_Result,MyTask)
d0 d0 a0 a1 a2
Long = DND_GiveResult(Struct Task,Struct Rastport,Struct T?_Result,
Struct Task)
FUNCTION
GiveResult() sends a copy of T?_Result to the given Task.
INPUTS
Targettask - see DND_Get()/INPUTS
Mytask - see DND_Get()/INPUTS
Rastport - rastport where the icon is placed.
T?_Result - address of TA_Result or TP_Result
RESULT
Ok - returns 0 if fails
returns -1 if success
BUGS
NONE
SEE ALSO
DND_TestArea(),DND_TestPolygon(),DND_Give(),DND_GiveData(),DND_Get()
dragndrop.library/DND_GiveData dragndrop.library/DND_GiveData
NAME
DND_GiveData -- Sends data to another task
SYNOPSIS
OK = DND_GiveData(TargetTask,Mytask,Data)
a0 a1 a2
Long = DND_GiveData(Struct task,Struct task,Long Data)
FUNCTION
GiveData() send a Datastructure to given task.
INPUTS
Targettask - see DND_Get()/INPUTS
Mytask - see DND_Get()/INPUTS
or Null
Data:
if MyTask is zero data is a pointer to a special taglike list. First
element *MUST* be MYTASK! All following elements are not defined yet!
See "www.geocities.com/SiliconValley/Bridge/5737/Main/Preass.html"
for more information.
RESULT
Ok - returns 0 if fails
returns -1 if success
BUGS
NONE
SEE ALSO
DND_TestArea(),DND_TestPolygon(),DND_Give(),DND_GiveResult(),DND_Get()
dragndrop.library/DND_Info dragndrop.library/DND_Info
NAME
DND_Info -- gets infos about dragndrop.library
SYNOPSIS
Result=DND_Info()
FUNCTION
In a later version, dragndrop.library will send you informations about
the library like version,revision,logins,functions and prefs.
INPUTS
NONE
RESULT
returns actual -1
BUGS
NONE
SEE ALSO
DND_FreeInfo()
dragndrop.library/DND_IsOnline dragndrop.library/DND_IsOnline
NAME
DND_IsOnline() -- asks library if task has logged in
SYNOPSIS
Result = DND_Isonline(Task)
d0 d0
Long = DND_IsOnline(struct Task)
FUNCTION
Checks if a given task has logged in.
INPUTS
Task - see DND_Get()/INPUTS
RESULT
Result - returns 0 if it fails to find task
returns Task if it finds the task
BUGS
NONE
SEE ALSO
DND_WhoIsOnline(), DND_Login(), DND_Logout()
dragndrop.library/DND_Login dragndrop.library/DND_Login
NAME
DND_Login -- logs task into database
SYNOPSIS
OK = DND_Login(Task)
d0 d0
long = DND_Login(Struct Task)
FUNCTION
Tries to log your task into the internal database.
INPUTS
Task - see DND_Get()/INPUTS
RESULT
ok - return -1 if database is full
return 0 if another task has already logged in with your
taskstructure
return TASK if logged in.
BUGS
NONE
SEE ALSO
DND_Logout(), DND_Whoisonline(), DND_IsOnline()
dragndrop.library/DND_Logout() dragndrop.library/DND_Logout()
NAME
DND_Logout -- loggs your task out
SYNOPSIS
OK = DND_Logout(Task)
d0 d0
Long = DND_Logout(struct Task)
FUNCTION
Loogs you task out of internal database. Other tasks can`t find you
anymore.
INPUTS
Task - see DND_Get()/INPUTS
RESULT
ok - return -1 if databaseend is hit while searching your Task
return 0 if your task can`t be found
return TASK if logged out.
BUGS
NONE
SEE ALSO
DND_Login(), DND_Whoisonline(), DND_IsOnline()
dragndrop.library/DND_MoveDrag dragndrop.library/DND_MoveDrag
NAME
DND_MoveDrag -- Moves your dragicon
SYNOPSIS
DND_MoveDrag(Drag,DeltaX,DeltaY)
DND_MoveDrag(Struct Drag,Long ,Long )
FUNCTION
Moves your dragicon around.
INPUTS
Drag - Result of DND_OpenDrag()
DeltaX - how far to move the Window on the x-axis
DeltaY - how far to move the Window on the y-axis
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_OpenDrag(), DND_CloseDrag()
dragndrop.library/DND_OpenDrag dragndrop.library/DND_OpenDrag
NAME
DND_OpenDrag -- Opens a dragicon on the given screen
SYNOPSIS
Drag = DND_OpenDrag(Rastport,TA_Result,Screen)
d0 a0 a1 a2
Long = DND_OpenDrag(Sruct Rastport,struct TA_Result,Struct Screen)
FUNCTION
This function opens a dragicon on your screen. It copies the graphic
from your rastport to the dragicon. You must use the TA_Resultstructure
to tell the function which region you want as a dragicon.
WARNING
In later versions of DND you could offer a own graphic for this
operation. So DON`T create a TA_RESULT on your own!
INPUTS
Rastport - rastport where to find the graphics
TA_RESULT - result of DND_TestArea()
Screen - screen on which you want to place the new dragicon
"You could open a dragicon on someoneothers screen!?! Why ???"
"Think of an application with two screens !!!( maybe AGA and CGX )"
RESULT
Drag - Dragstructure ( no usefull data for you )
BUGS
NONE
SEE ALSO
DND_CloseDrag(), DND_MoveDrag(), DND_Openpolygon()
dragndrop.library/DND_OpenPolygon dragndrop.library/DND_OpenPolygon
NAME
DND_Openpolygon -- opens a given polygon as dragicon
SYNOPSIS
Drag = DND_Openpolygon(Rastport,TP_result,Screen)
see DND_OpenDrag()
FUNCTION
Opens a Polygon as Dragicon --> DND_OpenDrag
INPUTS
see DND_OpenDrag
RESULT
NONE
BUGS
NONE
SEE ALSO
DND_OpenDrag(), DND_CloseDrag() ,DND_MoveDrag()
dragndrop.library/DND_TestArea dragndrop.library/DND_TestArea
NAME
DND_TestArea -- tests if a mouseclick hits a drag/dropicon
SYNOPSIS
TA_Result = DND_TestArea(Field,Mx,My)
d0 a0 d0 d1
Long = DND_TestArea(Struct Dragarea, Long, Long)
FUNCTION
This function checks if a mouseclick is inside of one dragicon of the
given dragarea. You can use a droparea ( similiar to dragarea ) instead!
INPUTS
Dragarea - see DND_CreateDrag()
Mx - X-mousepos found in the intuimessage
My - Y-mousepos found in the intuimessage
RESULT
TA_Result - returns 0 if not inside of one dragicon
returns TA_Resultstructure if it`s a hit
BUGS
NONE
SEE ALSO
DND_TestPolygon(), DND_CreateDrag
dragndrop.library/DND_TestPolygon dragndrop.library/DND_TestPolygon
NAME
DND_TestPolygon -- tests if a mouseclick hits a Polygon
SYNOPSIS
TP_Result = DND_TestPolygon(Polygon,Mx,My)
d0 a0 d0 d1
Long = DND_TestPolygon(Struct Polygon, Long, Long)
FUNCTION
This function checks if a mouseclick is inside of a given Polygon.
INPUTS
Polygon - see DND_CreatePolygon()
Mx - X-mousepos found in the intuimessage
My - Y-mousepos found in the intuimessage
RESULT
TP_Result - returns 0 if not inside of the polygon
returns TP_Resultstructure if it`s a hit
BUGS
NONE
SEE ALSO
DND_TestArea(), DND_CreatePolygon
dragndrop.library/DND_Whoisonline dragndrop.library/DND_Whoisonline
NAME
DND_WhoIsOnline -- Copies actual internal database
SYNOPSIS
OK = DND_WhoIsOnline(Buffer, MaxChars)
Long = DND_WhoIsOnline(char Buffer, Long)
FUNCTION
copies as much as possible data from the internal database to
your buffer , so you can access it. Your buffer will be filled with
all tasks logged in or as much as possible.
INPUTS
buffer - pointer to a free memoryblock
maxchars - lenght of buffer
RESULT
ok - returns 0 if your buffer runs out of space
returns -1 if ok
BUGS
NONE
SEE ALSO
DND_IsOnline(), DND_Login(), DND_Logout()
dragndrop.library/SetMousePos dragndrop.library/SetMousePos
NAME
SetMousePos -- Sets Mouseposition into screen and window
SYNOPSIS
SetMousePos(Screen,Window,MouseX,MouseY)
A1 A0 D0 D1
FUNCTION
Set MouseX and MouseY into intuitionbase, screenstructure and
windowstructure.
INPUTS
Screen - screen structure for window
Window - window structure for screen
MouseX - Mouse Pos X
MouseY - Mouse Pos Y
RESULT
NONE
BUGS
NONE
SEE ALSO
dragndrop.library/SetMousePosDelta dragndrop.library/SetMousePosDelta
NAME
SetMousePosDelta -- moves mousepointer
SYNOPSIS
SetMousePosDelta(DeltaX,DeltaY)
D0 D1
SetMousePosDelta(Byte , Byte)
FUNCTION
moves global mousepointer.
This causes a IDCMP_MOUSEMOVE every time you use this function, so don`t
forget to wait for your guimessage to keep in sync.
INPUTS
DeltaX - ( -127 ... 127 )
DeltaY - ( -127 ... 127 )
WARNING
This function uses DHA (DirectHardwareAccess).
Works fine with AGA & CGX
RESULT
NONE
BUGS
NONE
SEE ALSO
dragndrop.library/DND_OpenDragWB dragndrop.library/DND_OpenDragWB
NAME
DND_OpenDragWB -- Opens a dragicon on the Workbench
SYNOPSIS
Drag = DND_OpenDragWB(Rastport,TA_Result,Window)
d0 a0 a1 a2
Long = DND_OpenDragWB(Struct Rastport,struct TA_Result,struct window)
FUNCTION
This function opens a dragicon the Workbench. It copies the graphic
from your rastport to the dragicon. You must use the TA_Resultstructure
to tell the function which region you want as a dragicon.
WARNING
In later versions of DND you could offer a own graphic for this
operation. So DON`T create a TA_RESULT on your own!
INPUTS
Rastport - rastport where to find the graphics
TA_RESULT - result of DND_TestArea()
window - valid windowstructure where to get the gfx data!
RESULT
Drag - Dragstructure ( no usefull data for you )
BUGS
NONE
SEE ALSO
DND_CloseDrag(), DND_MoveDrag(), DND_Openpolygon(), DND_OpenDrag()
dragndrop.library/DND_GetDataMsgFromID dragndrop.library/DND_GetDataMsgFromID
NAME
DND_GetDataMsgFromID -- gets a message from the queue with parameter
SYNOPSIS
Drag = DND_GetDataMsgFromID(TaskID,SenderID)
d0 d0 d1
Long = DND_GetDataMsgFromID(struct Task,Struct SenderID)
FUNCTION
This function gets a datastructure from datamessagepipe send by
SenderID. This is usefull if you wanna have only messages from one
Task i.e. if you have send a message and wait for the reply and
you won`t get distrubed by other messages ( maybe you won`t handle them there )
INPUTS
Task - see DND_Get()/INPUTS
SenderID - ID from the tasks which you expect who send you a message
RESULT
ok - returns -1 for failure or a DataStructure
BUGS
NONE
SEE ALSO
DND_GetData(), DND_GetDataMsg(), DND_CheckforDataMsg(),
DND_CheckforDataMsgFromID(), DND_GetDataMsgFromID()
dragndrop.library/DND_GetDataMsg dragndrop.library/DND_GetDataMsg
NAME
DND_GetDataMsg -- gets a message from queue with parameter
SYNOPSIS
Drag = DND_GetDataMsg(TaskID,SenderID,Data)
d0 d0 d1 d2
Long = DND_GetDataMsg(struct Task,Struct SenderID,long Data)
FUNCTION
This function gets a datastructure from datamessagepipe send by
SenderID if data is equal to given Data.
This is usefull if you expect a Reply Message from another task
and want to remove it.
INPUTS
Task - see DND_Get()/INPUTS
SenderID - ID from the tasks which you expect who send you a message
Data - Data or Pointer to Datafield, but that will not be easy :-))
RESULT
ok - returns -1 for failure or a DataStructure
BUGS
NONE
SEE ALSO
DND_GetData(), DND_GetDataMsg(), DND_CheckforDataMsg(),
DND_CheckforDataMsgFromID(), DND_GetDataMsgFromID()
dragndrop.library/DND_CheckForDataMsgFromID
NAME
DND_CheckForDataMsgFromID -- Checks if a msg from ID is on the queue
SYNOPSIS
Drag = DND_CheckforDataMsgFromID(TaskID,SenderID)
d0 d0 d1
Long = DND_CheckForDataMsgFromID(struct Task,Struct SenderID)
FUNCTION
This function tests if a messages from SenderID is available on the
messagepipe.
INPUTS
Task - see DND_Get()/INPUTS
SenderID - ID from the tasks which you expect who send you a message
RESULT
ok - returns -1 for failure or a DataStructure
BUGS
NONE
SEE ALSO
DND_GetData(), DND_GetDataMsg(), DND_CheckforDataMsg(),
DND_CheckforDataMsgFromID(), DND_GetDataMsgFromID()
dragndrop.library/DND_CheckForDataMsg dragndrop.library/DND_CheckForDataMsg
NAME
DND_GetDataMsg -- checks for a message on the queue with parameter
SYNOPSIS
Drag = DND_CheckForDataMsg(TaskID,SenderID,Data)
d0 d0 d1 d2
Long = DND_CheckForDataMsg(struct Task,Struct SenderID,long Data)
FUNCTION
This function tests if a messages from SenderID is available on the
messagepipe that contains the given DATA.
i.e. you can use this for PING-PONG messages
INPUTS
Task - see DND_Get()/INPUTS
SenderID - ID from the tasks which you expect who send you a message
Data - Data or Pointer to Datafield, but that will not be easy :-))
RESULT
ok - returns -1 for failure or a DataStructure
BUGS
NONE
SEE ALSO
DND_GetData(), DND_GetDataMsg(), DND_CheckforDataMsg(),
DND_CheckforDataMsgFromID(), DND_GetDataMsgFromID()